package com.glink.manage.mqtt.common;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Data
public class ApiProperties {
    @Value("${api.analysisHostIp:}")
    private String analysisHostIp;
    @Value("${api.areaHostIp:}")
    private String areaHostIp;
    @Value("${api.areaHostPort:0}")
    private int areaHostPort;
    @Value("${api.httpType:}")
    private String httpType;
    @Value("${api.picAnalyseNotifyUrl:}")
    private String picAnalyseNotifyUrl;
    @Value("${api.heartUrl:}")
    private String heartUrl;
    @Value("${api.algorithmUsedUrl:}")
    private String algorithmUsedUrl;
    @Value("${api.retryTime:3}")
    private int retryTime;

    public String picAnalyseNotifyDomain(String ipPort) {
        if (ipPort == null) {
            return null;
        }
        if (!ipPort.startsWith("http") && !ipPort.startsWith("HTTP")) {
            ipPort = this.httpType + "://" + ipPort;
        }
        return ipPort + this.picAnalyseNotifyUrl;
    }
}
 
 
 